<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
  <title id="pa137116">createlang</title>
  <body>
    <p id="client_util_desc">Defines a new procedural language for a database.</p>
    <section id="section2">
      <title>Synopsis</title>
      <codeblock id="client_util_synopsis"><b>createlang</b> [<varname>connection_option</varname> ...] [<b>-e</b>] <varname>langname</varname> [[<b>-d</b>] <varname>dbname</varname>]

<b>createlang</b> [<varname>connection-option</varname> ...] <b>-l</b> <varname>dbname</varname>

<b>createlang</b> <b>-? | --help</b>

<b>createlang</b> <b>-V | --version</b></codeblock>
    </section>
    <section id="section3">
      <title>Description</title>


      <p>The <codeph>createlang</codeph> utility adds a new procedural language to a database.
          <codeph>createlang</codeph> is a wrapper around the <codeph>SQL</codeph> command
          <codeph><xref
              href="../../ref_guide/sql_commands/CREATE_EXTENSION.xml#topic1"/></codeph>.</p>
      <note><codeph>createlang</codeph> is deprecated and may be removed in a future release. From
        Greenplum Database 6.x, using <codeph>createlang</codeph> to add a procedural language
        package generates an error. Use the <codeph>CREATE EXTENSION</codeph> command instead.</note>

      <p>The procedural language packages included in the standard Greenplum Database
        distribution are:</p>
      <ul>
        <li id="pa140043"><codeph>PL/pgSQL</codeph></li>
        <li id="pa140054"><codeph>PL/Perl</codeph></li>
        <li id="pa140061"><codeph>PL/Python</codeph></li>
      </ul>
      <p>The <codeph>PL/pgSQL</codeph> language is registered in all databases by default.</p>
      <p>Greenplum Database also has language handlers for <codeph>PL/Java</codeph> and
          <codeph>PL/R</codeph>, but those languages are not pre-installed with Greenplum Database.
        See the <xref href="../../analytics/pl_java.xml" scope="peer" format="dita">Greenplum
          PL/Java Language Extension</xref> and <xref href="../../analytics/pl_r.xml" scope="peer"
          format="dita">Greenplum PL/R Language Extension</xref> sections in the documentation for
        more information.</p>
    </section>
    <section id="section4"><title>Options</title><parml>
        <plentry>
          <pt>langname</pt>
          <pd>Specifies the name of the procedural language to be installed. (This name is
            lower-cased.)</pd>
        </plentry>
        <plentry>
          <pt>[-d] <varname>dbname</varname> | [--dbname=]<varname>dbname</varname></pt>
          <pd>Specifies the database to which the language should be added. The default is to use the
              <codeph>PGDATABASE</codeph> environment variable setting, or the same name as the
            current system user.</pd>
        </plentry>
        <plentry>
          <pt>-e | --echo</pt>
          <pd>Echo the commands that <codeph>createlang</codeph> generates and sends to the
            server.</pd>
        </plentry>
        <plentry>
          <pt>-l <varname>dbname</varname> | --list <varname>dbname</varname></pt>
          <pd>Show a list of already installed languages in the target database. </pd>
        </plentry>
        <plentry>
          <pt>-V | --version</pt>
          <pd>Print the <codeph>createlang</codeph> version and exit.</pd>
        </plentry>
        <plentry>
          <pt>-? | --help</pt>
          <pd>Show help about <codeph>createlang</codeph> command line arguments, and exit.</pd>
        </plentry>
      </parml><sectiondiv id="section5"><b>Connection Options</b><parml>
          <plentry>
            <pt>-h <varname>host</varname> | --host=<varname>host</varname></pt>
            <pd>The host name of the machine on which the Greenplum
              master database server is running. If not specified, reads from the environment
              variable <codeph>PGHOST</codeph> or defaults to localhost.</pd>
          </plentry>
          <plentry>
            <pt>-p <varname>port</varname> | --port=<varname>port</varname></pt>
            <pd>The TCP port on which the Greenplum master database
              server is listening for connections. If not specified, reads from the environment
              variable <codeph>PGPORT</codeph> or defaults to <codeph>5432</codeph>.</pd>
          </plentry>
          <plentry>
            <pt>-U <varname>username</varname> | --username=<varname>username</varname></pt>
            <pd>The database role name to connect as. If not specified, reads from the environment
              variable <codeph>PGUSER</codeph> or defaults to the current system role name.</pd>
          </plentry>
          <plentry>
            <pt>-w | --no-password</pt>
            <pd>Never issue a password prompt. If the server requires password authentication and a
              password is not available by other means such as a <codeph>.pgpass</codeph> file, the
              connection attempt will fail. This option can be useful in batch jobs and scripts
              where no user is present to enter a password.</pd>
          </plentry>
          <plentry>
            <pt>-W | --password</pt>
            <pd>Force a password prompt.</pd>
          </plentry>
        </parml></sectiondiv></section>
    <section id="section6">
      <title>Examples</title>
      <p>To install the language <codeph>plperl</codeph> into the database
        <codeph>mytestdb</codeph>:</p>
      <codeblock>createlang plperl mytestdb</codeblock>
    </section>
    <section id="section7">
      <title>See Also</title>
      <p> <ph otherprops="op-help">
        <codeph><xref href="droplang.xml#topic1"/></codeph>,
        <codeph><xref href="../../ref_guide/sql_commands/CREATE_EXTENSION.xml#topic1"/></codeph>,
        <codeph><xref href="../../ref_guide/sql_commands/CREATE_LANGUAGE.xml#topic1"/></codeph>,
        <codeph><xref href="../../ref_guide/sql_commands/DROP_LANGUAGE.xml#topic1"/></codeph></ph></p>
    </section>
  </body>
</topic>
